home *** CD-ROM | disk | FTP | other *** search
/ Aminet 21 / Aminet 21 (1997)(GTI - Schatztruhe)[!][Oct 1997].iso / Aminet / mus / play / SPLibDev.lha / superplay-lib_DEV / Programmers / Oberon-2 / Interfaces / SuperPlay.mod < prev   
Encoding:
Text File  |  1997-08-15  |  8.2 KB  |  266 lines

  1. (********************************************************************
  2.  
  3. :Program.     SuperPlay.mod
  4. :Contents.    interface module for superplay.library
  5. :Copyright.   © 1994 by Andreas R. Kleinert
  6. :Language.    Oberon-2
  7. :Translator.  A+L Amiga Oberon Compiler V3.11d
  8. :History.     V4.1  indy  23-Dec-95 first translation of c include
  9. :History.     V5.1  indy  07-Jan-96 update to c include V5.1(8.8.96)
  10. :History.                           change GetErrorString() e.STRPTR TO e.LSTRPTR
  11. *********************************************************************)
  12.  
  13. MODULE SuperPlay;
  14.  
  15. (* $VER: SuperPlay 5.1 (07.01.96)
  16.  
  17.  * !!! IMPORTANT NOTE !!!
  18.  * Before procedures of this module may be used, you have to check
  19.  * SuperPlay.base#NIL because opening SuperPlay fails on Amigas without
  20.  * SuperPlay.library V4.0+.
  21.  
  22.  * If you want to use procedures of this module which needs
  23.  * SuperPlay.library > V4.0 you have to check SuperPlay.base.libNode.version
  24.  * (SuperPlay.LibVer()).
  25.  
  26.  Example:
  27.  --------
  28.    IMPORT
  29.      sp: SuperPlay,
  30.      io;
  31.  
  32.    BEGIN
  33.      IF sp.base=NIL THEN
  34.        io.WriteString ("I need SuperPlay.library V4.0+\n"); END;
  35.  
  36.      (* Example for Version >= V4.0+ check *)
  37.  
  38.      IF  sp.LibVer(sp.base)<5 THEN
  39.        io.WriteString ("I need SuperPlay.library V4.0+\n"); END;
  40.      END;
  41.  
  42.  
  43.   This Oberon-2 interface module contains the c-includes:
  44.   -------------------------------------------------------
  45.     superplay/superplaybase.h
  46.       Version    : 5.1
  47.       Date       : 8.8.1996
  48.       Written by : Andreas R. Kleinert
  49.  
  50.     superplay/superplay.h
  51.       Version    : 5.1
  52.       Date       : 8.8.1996
  53.       Written by : Andreas R. Kleinert
  54. *)
  55.  
  56.  
  57. IMPORT
  58.   e   *: Exec,
  59.   d   *: Dos,
  60.   dt  *: Datatypes,
  61.   i   *: Intuition,
  62.   iff *: IFFParse,
  63.   u   *: Utility,
  64.  
  65.   spo *: spObjects;
  66. (*****************************************************************************)
  67.  
  68.  
  69. CONST
  70.   name     - = "superplay.library";
  71.  
  72.   (***************************************
  73.    *  superplay/superplay.h              *
  74.    *    Version    : 5.1                 *
  75.    *    Date       : 8.8.1996            *
  76.    *    Written by : Andreas R. Kleinert *
  77.    ****************************************)
  78.  
  79.   (***************************************************
  80.    *                                                 *
  81.    * Version Defines                                 *
  82.    *                                                 *
  83.    ***************************************************)
  84.  
  85.   libMinimum = 5 ;  (* lowest supported version                   *)
  86.   libVersion = 5;   (* just for info, should not be used anywhere *)
  87.  
  88.  
  89.   (***************************************************
  90.    *                                                 *
  91.    * MACROs for Version-Tests                        *
  92.    *                                                 *
  93.    ***************************************************)
  94.  
  95. PROCEDURE LibVer*(lib: e.LibraryPtr): INTEGER;
  96.  
  97. BEGIN
  98.   RETURN lib.version;
  99. END LibVer;
  100.  
  101.  
  102. PROCEDURE OSVer*(): INTEGER;
  103.  
  104. BEGIN
  105.   RETURN LibVer(e.SysBase);
  106. END OSVer;
  107.  
  108.  
  109. TYPE
  110.   SuperPlayBasePtr * = UNTRACED POINTER TO SuperPlayBase;
  111.  
  112.   (***************************************************
  113.    *                                                 *
  114.    * DEFINES                                         *
  115.    *                                                 *
  116.    ***************************************************)
  117.  
  118.  
  119. (* Possible FileTypes *)
  120.  
  121. CONST
  122.   filetypeNone    - = 0;
  123.   filetypeUnknown - = filetypeNone;
  124.  
  125.      (*
  126.         above : External, user defined FileTypes
  127.                 (defined EACH TIME NEW at Library's startup-time).
  128.      *)
  129.  
  130.   filetypeIllegal - = 0FFFFFFFFH;
  131.  
  132.  
  133. (* Possible SubTypes of FileTypes *)
  134.  
  135.   subtypeNone     - = 0;
  136.   subtypeUnknown  - = subtypeNone;
  137.  
  138.      (*
  139.         above : External, user defined FileSubTypes
  140.                 (defined EACH TIME NEW at Library's startup-time).
  141.      *)
  142.  
  143.   subtypeIllegal  - = 0FFFFFFFFH;
  144.  
  145.  
  146. (* Possible Input and Output mediums *)
  147.  
  148.   mediumNone      - = 0;
  149.   mediumIllegal   - = 0FFFFFFFFH;
  150.  
  151.   mediumDisk      - = 1;              (* Play and Write options   *)
  152.   mediumClip      - = 2;
  153.  
  154.      (* might not be supported by all kinds of File(Sub)Types *)
  155.  
  156.  
  157.   (***************************************************
  158.    *                                                 *
  159.    * Function Error Codes                            *
  160.    *                                                 *
  161.    ***************************************************)
  162.  
  163.   errMaxErrorTextLength - = 80;    (* plus Null-Byte *)
  164.  
  165.   errNoError            - =  0;
  166.   errInternalError      - =  0FFFFFFFFH;
  167.  
  168.   errUnknownFileFormat  - =  1;
  169.   errFileNotFound       - =  2;
  170.   errNoMemory           - =  3;
  171.   errIFFParseError      - =  4;
  172.   errNoClipboard        - =  5;
  173.   errNoFile             - =  6;
  174.   errNoHandle           - =  7;
  175.   errNoData             - =  8;
  176.   errNoInformation      - =  9;
  177.   errIllegalAccess      - = 10;
  178.   errDecodeError        - = 11;
  179.   errUnknownParameters  - = 12;
  180.   errActionNotSupported - = 13;
  181.   errNoChannels         - = 14;
  182.   errVersionConflict    - = 15;
  183.   errNoSamplesLoaded    - = 16;
  184.  
  185.         (* Each new Library-Subversion may contain new Codes above
  186.            the last one of these.
  187.            So do not interpret the codes directly, but use
  188.            SPL_GetErrorString.
  189.            Maybe, newer Codes might not be listed up here.
  190.         *)
  191.  
  192.  
  193. (************************************
  194.  * superplay/superplaybase.h        *
  195.  * Version    : 5.1                 *
  196.  * Date       : 8.8.1996            *
  197.  * Written by : Andreas R. Kleinert *
  198.  ************************************)
  199.  
  200.    (*
  201.       All entries are READ-ONLY.
  202.       The private entries should NEVER be accessed.
  203.  
  204.       Oberon-2:
  205.         spObjectList is define as read- and writeable because with
  206.         Oberon V3.11d its not possible to get the address of a read only
  207.         variable with SYSTEM.ADR().
  208.    *)
  209.  
  210. TYPE
  211.   SuperPlayBase   - = STRUCT (libNode - : e.Library)
  212.     segList       - : e.APTR;
  213.     sysBase       - : e.ExecBasePtr;
  214.     dosBase       - : d.DosLibraryPtr;
  215.     intuitionBase - : i.IntuitionBasePtr;
  216.     spObjectList  * : e.List;
  217.     private1      - : LONGINT;
  218.     private2      - : LONGINT;
  219.     utilityBase   - : u.UtilityBasePtr;
  220.     iffParseBase  - : e.LibraryPtr;          (* may be NULL *)
  221.     dataTypesBase - : e.LibraryPtr;          (* may be NULL *)
  222.   END;
  223.  
  224.  
  225. VAR
  226.   base -: SuperPlayBasePtr;
  227.  
  228.  
  229. (*  Functions available since Version 1 *)
  230.  
  231. PROCEDURE AllocHandle     * {base, - 30} (future{9}: e.APTR): e.APTR;
  232. PROCEDURE FreeHandle      * {base, - 36} (handle{9}: e.APTR);
  233. PROCEDURE StopReplay      * {base, - 42} (handle{9}: e.APTR);
  234. PROCEDURE FreeResources   * {base, - 48} (handle{9}: e.APTR);
  235. PROCEDURE SuperPlay       * {base, - 54} (handle{9}: e.APTR; filename{10}: ARRAY OF CHAR): LONGINT;
  236. PROCEDURE SuperWrite      * {base, - 60} (handle{9}, sourceHandle{10}: e.APTR): LONGINT;
  237. PROCEDURE InitHandleAsDOS * {base, - 66} (handle{9}, future{10}: e.APTR): LONGINT;
  238. PROCEDURE InitHandleAsClip* {base, - 72} (handle{9}, future{10}: e.APTR): LONGINT;
  239. PROCEDURE SetWriteType    * {base, - 78} (handle{9}: e.APTR; writeType{10}: LONGINT; future{11}: e.APTR): LONGINT;
  240. PROCEDURE GetErrorString  * {base, - 84} (errorCode{9}: LONGINT): e.LSTRPTR;
  241. PROCEDURE SetWriteName    * {base, - 90} (handle{9}: e.APTR; writeName{10}: ARRAY OF CHAR; future{11}: e.APTR): LONGINT;
  242. PROCEDURE FileInfoRequest * {base, - 96} (handle{9}: e.APTR; window{10}: i.WindowPtr; future{11}: e.APTR): LONGINT;
  243. PROCEDURE SetReqIOWindow  * {base, -102} (handle{9}: e.APTR; window{10}: i.WindowPtr): LONGINT;
  244. PROCEDURE ReadPlayData    * {base, -108} (handle{9}: e.APTR; filename{10}: ARRAY OF CHAR): LONGINT;
  245. PROCEDURE ContinueReplay  * {base, -114} (handle{9}: e.APTR): LONGINT;
  246. PROCEDURE FastForward     * {base, -120} (handle{9}: e.APTR): LONGINT;
  247. PROCEDURE FastBackward    * {base, -126} (handle{9}: e.APTR): LONGINT;
  248.  
  249. (* Functions added with Version 2 *)
  250.  
  251. PROCEDURE GetSampleList   * {base, -132} (handle{9}: e.APTR; list{10}: UNTRACED POINTER TO spo.SampleListPtr): LONGINT;
  252. PROCEDURE SetSampleList   * {base, -138} (handle{9}: e.APTR; list{10}: spo.SampleListPtr): LONGINT;
  253.  
  254. (* Functions added with Version 4 *)
  255.  
  256. PROCEDURE GetFileType     * {base, -144} (handle{9}: e.APTR; filename{10}: ARRAY OF CHAR; fileType{11}: UNTRACED POINTER TO LONGINT): LONGINT;
  257.  
  258.  
  259. BEGIN
  260.   base :=  e.OpenLibrary(name, 4);
  261.  
  262. CLOSE
  263.   IF base#NIL THEN e.CloseLibrary(base) END;
  264.  
  265. END SuperPlay.
  266.